﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AddUser.aspx.vb" Inherits="Training.AddUser" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Manage Groups</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="ctr">
        <h2>Add User</h2>
        
        <asp:Label ID="lblAlert" runat="server" Text="" CssClass="Alert"></asp:Label>
        
        <div style="width:700px;text-align:left;margin:0 auto;" class="text">
            <fieldset>
                <legend>User Information</legend>
                
                <div class="row">
                    <div class="half">
                        First Name: 
                        <asp:RequiredFieldValidator ID="rfFname" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbFname" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbFname" CssClass="formfield" 
                            runat="server" Width="200px"></asp:TextBox>
                    </div>
                    <div class="half">
                         Last Name: 
                        <asp:RequiredFieldValidator ID="rfLname" runat="server" ErrorMessage="required" 
                             ControlToValidate="tbLname" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbLname" CssClass="formfield" 
                            runat="server" Width="200px"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Company/Site:<asp:RequiredFieldValidator ID="rfCompany" runat="server"
                            ErrorMessage="required" ControlToValidate="tbComp" 
                            CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbComp" CssClass="formfield" Width="200px" runat="server"></asp:TextBox>
                    </div>
                    <div class="half">
                        Address:<br />
                        <asp:TextBox ID="tbAdr" CssClass="formfield" Width="200px" runat="server"></asp:TextBox>
                    </div>
                </div>
                
                <div class="row">
                    <div class="half">
                        City:<br />
                        <asp:TextBox ID="tbCity" CssClass="formfield" Width="200px" runat="server"></asp:TextBox>
                    </div>
                    <div class="half">
                        State:<br />
                        <asp:DropDownList ID="ddlState" runat="server" AppendDataBoundItems="True" 
                            DataSourceID="dsStates" DataTextField="StateName" 
                            DataValueField="StateId" CssClass="formfield">
                            <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Zip:<asp:RequiredFieldValidator ID="rfZip" runat="server"
                            ErrorMessage="required" ControlToValidate="tbZip" 
                            CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbZip" CssClass="formfield" Width="200px" runat="server"></asp:TextBox>
                    </div>
                    <div class="half">
                        Phone:<asp:RequiredFieldValidator ID="rfPhone" runat="server"
                            ErrorMessage="required" ControlToValidate="tbPhone" 
                            CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbPhone" CssClass="formfield" Width="200px" runat="server"></asp:TextBox>
                    </div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Group: 
                        <asp:RangeValidator ID="rvGroup" runat="server" ErrorMessage="required" 
                            ControlToValidate="ddlGroup" CssClass="small" Display="Dynamic" 
                            MaximumValue="5000" MinimumValue="1" Type="Integer"></asp:RangeValidator><br />
                        <asp:DropDownList ID="ddlGroup" runat="server" DataSourceID="dsGetAllGroups" 
                            DataTextField="GroupName" DataValueField="GroupID" 
                            AppendDataBoundItems="True" CssClass="formfield">
                            <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div class="half">
                        Activate User:<br />
                        <asp:RadioButtonList ID="rblActive" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1" Text="Yes" Selected="True"></asp:ListItem>
                            <asp:ListItem Value="0" Text="No"></asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Site Code:<br />
                        <asp:TextBox ID="tbSiteCode" CssClass="formfield" Width="200px" 
                            runat="server"></asp:TextBox><br />
                        <span class="small">(if applicable)</span>
                    </div>
                    <div class="half">&nbsp;</div>
                    <div class="clr"></div>
                </div>
                
            </fieldset>
            
            <fieldset>
                <legend>Login Information</legend>
                
                <div class="row">
                    <div class="half">
                        Login Name: 
                        <asp:RequiredFieldValidator ID="rfLogin" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbLogin" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <asp:TextBox ID="tbLogin" CssClass="formfield" Width="200px" 
                            runat="server"></asp:TextBox>
                    </div>
                    <div class="half">&nbsp;</div>
                    <div class="clr"></div>
                </div>
                
                
                <div class="row">
                    <div class="half">
                        Password*: 
                        <asp:RequiredFieldValidator ID="rfPass" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbPass" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        
                        <asp:TextBox ID="tbPass" CssClass="formfield" Width="200px" 
                            runat="server" TextMode="Password"></asp:TextBox>
                        <cc1:PasswordStrength ID="tbPass_PasswordStrength" runat="server" 
                            Enabled="True" TargetControlID="tbPass" 
                            MinimumNumericCharacters="0" 
                            MinimumSymbolCharacters="0" 
                            MinimumUpperCaseCharacters="0" 
                            MinimumLowerCaseCharacters="0" 
                            PreferredPasswordLength="6" DisplayPosition="LeftSide">
                        </cc1:PasswordStrength>
                    </div>
                    <div class="half">
                        Confirm Password: 
                        <asp:RequiredFieldValidator ID="rfPConf" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbPConf" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="cvPassword" runat="server" ControlToCompare="tbPass" 
                            ControlToValidate="tbPConf" CssClass="small" Display="Dynamic" 
                            ErrorMessage="passwords do not match"></asp:CompareValidator>
                        <br />
                        <asp:TextBox ID="tbPConf" CssClass="formfield" Width="200px" 
                            runat="server" TextMode="Password"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
                <div class="row">
                    <div class="half">
                        Email: 
                        <asp:RequiredFieldValidator ID="rfEmail" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbEmail" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="reEmail" runat="server" 
                            ControlToValidate="tbEmail" CssClass="small" Display="Dynamic" 
                            ErrorMessage="invalid email" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        <br />
                        <asp:TextBox ID="tbEmail" CssClass="formfield" Width="200px" 
                            runat="server"></asp:TextBox>
                    </div>
                    <div class="half">
                        Confirm Email: 
                        <asp:RequiredFieldValidator ID="rfEConf" runat="server" ErrorMessage="required" 
                            ControlToValidate="tbEConf" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="cvEmail" runat="server" ControlToCompare="tbEmail" 
                            ControlToValidate="tbEConf" CssClass="small" Display="Dynamic" 
                            ErrorMessage="email does not match"></asp:CompareValidator>
                        <br />
                        <asp:TextBox ID="tbEConf" CssClass="formfield" Width="200px" 
                            runat="server"></asp:TextBox>
                    </div>
                    <div class="clr"></div>
                </div>
                
            </fieldset>
        </div>
        <br />
        <p class="small">(* Password requires 6 characters)</p>
        
        <asp:Button ID="btnAddUser" runat="server" CssClass="button" Text="Add User" />
        &nbsp;
        <asp:Button ID="btnClear" runat="server" CssClass="button" Text="Clear Fields" CausesValidation="false" />
        
        <br />
        <p><a href="Default.aspx">Admin Main</a></p>
        
        
    </div>
    
    <asp:SqlDataSource ID="dsStates" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [StateId], [StateName] FROM [States] ORDER BY [StateName]"></asp:SqlDataSource>
    
    <asp:SqlDataSource ID="dsGetAllGroups" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [GroupID], [GroupName] FROM [Groups] ORDER BY [GroupName]"></asp:SqlDataSource>
    </form>
</body>
</html>
